<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>SoapVar constructor</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="soapvar.construct.html">SoapVar::__construct</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="book.yar.html">Yar</a></div>
 <div class="up"><a href="class.soapvar.html">SoapVar</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="soapvar.soapvar" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">SoapVar::SoapVar</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.0.1)</p><p class="refpurpose"><span class="refname">SoapVar::SoapVar</span> &mdash; <span class="dc-title">SoapVar constructor</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-soapvar.soapvar-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>SoapVar::SoapVar</strong></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$data</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$encoding</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$type_name</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$type_namespace</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$node_name</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$node_namespace</code></span>
  ]]]] )</div>

  <p class="para rdfs-comment">
   Constructs a new <a href="class.soapvar.html" class="classname">SoapVar</a> object.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-soapvar.soapvar-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">data</code></em></dt>

     <dd>

      <p class="para">
       The data to pass or return.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">encoding</code></em></dt>

     <dd>

      <p class="para">
       The encoding ID, one of the <em>XSD_...</em> constants.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">type_name</code></em></dt>

     <dd>

      <p class="para">
       The type name.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">type_namespace</code></em></dt>

     <dd>

      <p class="para">
       The type namespace.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">node_name</code></em></dt>

     <dd>

      <p class="para">
       The XML node name.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">node_namespace</code></em></dt>

     <dd>

      <p class="para">
       The XML node namespace.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-soapvar.soapvar-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-5216">
    <p><strong>Example #1 <span class="function"><strong>SoapVar::SoapVar()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">class&nbsp;</span><span style="color: #0000BB">SOAPStruct&nbsp;</span><span style="color: #007700">{<br />&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;</span><span style="color: #0000BB">SOAPStruct</span><span style="color: #007700">(</span><span style="color: #0000BB">$s</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$f</span><span style="color: #007700">)&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">varString&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$s</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">varInt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">varFloat&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$f</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /></span><span style="color: #0000BB">$client&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">SoapClient</span><span style="color: #007700">(</span><span style="color: #0000BB">null</span><span style="color: #007700">,&nbsp;array(</span><span style="color: #DD0000">'location'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"http://localhost/soap.php"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'uri'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"http://test-uri/"</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">$struct&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">SOAPStruct</span><span style="color: #007700">(</span><span style="color: #DD0000">'arg'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">34</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">325.325</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$soapstruct&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">SoapVar</span><span style="color: #007700">(</span><span style="color: #0000BB">$struct</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SOAP_ENC_OBJECT</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"SOAPStruct"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"http://soapinterop.org/xsd"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$client</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">echoStruct</span><span style="color: #007700">(new&nbsp;</span><span style="color: #0000BB">SoapParam</span><span style="color: #007700">(</span><span style="color: #0000BB">$soapstruct</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"inputStruct"</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-soapvar.soapvar-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="methodname"><a href="soapclient.soapcall.html" class="methodname" rel="rdfs-seeAlso">SoapClient::__soapCall()</a> - Calls a SOAP function</span></li>
    <li class="member"><span class="methodname"><a href="soapparam.soapparam.html" class="methodname" rel="rdfs-seeAlso">SoapParam::SoapParam()</a> - SoapParam constructor</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="soapvar.construct.html">SoapVar::__construct</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="book.yar.html">Yar</a></div>
 <div class="up"><a href="class.soapvar.html">SoapVar</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
